﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data_Object;
using Models;

namespace Business_Object
{

    public class DiaDiemService
    {
        private IDiaDiemDao _address = DataAccess.DiaDiemDao;
        public List<DiaDiem> All()
        {
            return _address.All();
        }
       

        public DiaDiem Find(int id)
        {
            return _address.Find(id);

        }

        public void Insert(DiaDiem entity)
        {
            _address.Insert(entity);
        }
       

        public void Delete(int id)
        {
           _address.Delete(id);
        }

        public void Update(DiaDiem entity)
        {
            _address.Update(entity);
        }

        public void Share(DiaDiem entity, TaiKhoan tkDest)
        {
            DiaDiemDao _ddDAO = new DiaDiemDao();
            _ddDAO.Share(entity, tkDest);
        }


        public List<DiaDiem> FindByService(int id)
        {
           return  _address.FindByService(id);
        }

        public List<DiaDiem> FindByAccount(int id)
        {
            return _address.FindByAccount(id);
        }
    }
}
